<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <input type="text" v-model.number.trim.lazy="msg" />
      {{msg}}
      <select id="" v-model="sel">
        <option value="李白">李白</option>
        <option value="赵云">赵云</option>
        <option value="韩信">韩信</option>
      </select>
      {{sel}}
    </div>
  </body>
</html>
<script src="./vue.js"></script>
<script>
  // 修饰符（加在指令后面）
  // 1. .number 将输入的字符串转换为数值
  // 2. .trim 修正字符串两边的空格
  // 3. .lazy 在默认情况下，‘model’在每次‘input’事件触发后将输入框的值与数据进行同步
  const vm = new Vue({
    el: "#app",
    data: {
      msg: "马杀鸡",
      sel: "赵云",
    },
  });
</script>
